package com.example.fasttalk.model.intfc;

import java.io.Serializable;

public interface FastTalkSettingData extends Serializable {
  String getPassword();

  void setPassword(String password);

  String getServerUrl();

  void setServerUrl(String serverUrl);

  String getEmoticonPath();

  void setEmoticonPath(String emoticonPath);

  String getUserName();

  void setUserName(String userName);

  private static String toStr(FastTalkSettingData d) {
    return String.format("u:%s_p:%s_s:%s_e:%s", d.getUserName(), d.getPassword(), d.getServerUrl(), d.getEmoticonPath());
  }

  static boolean equals(FastTalkSettingData a, FastTalkSettingData b) {
    String strA = toStr(a);
    String strB = toStr(b);
    return strA.equals(strB);
  }

  static void copyTo(FastTalkSettingData data, FastTalkSettingData toData) {
    toData.setUserName(data.getUserName());
    toData.setPassword(data.getPassword());
    toData.setServerUrl(data.getServerUrl());
    toData.setEmoticonPath(data.getEmoticonPath());
  }

}
